﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace V5_WebControls
{
    [ToolboxData("<{0}:TextBoxLabelList runat=server></{0}:TextBoxLabelList>")]
    public class TextBoxLabelList : Panel
    {
        string _textboxList="1||1$$$$2||2";
        //public string Value
        //{
        //    //get { return value; }
        //}

        public string BindValue
        {
            set {
                _textboxList = value;
            }
        }

        protected override void RenderContents(HtmlTextWriter output)
        {
            if (_textboxList.Length > 0)
            {
                string[] str1 = _textboxList.Split(new string[] { "$$$$" }, StringSplitOptions.None);
                string outStrings = string.Empty,tempStr=string.Empty;
                for (int i = 0; i < str1.Length; i++)
                {
                    string[] str2 = str1[i].Split(new string[] { "||" }, StringSplitOptions.None);
                    outStrings += string.Format("<li><span>{0}</span><input id='' name='{1}' value/> </li>",
                        str2[0],
                        str2[1]
                        );
                }
                output.Write(outStrings);
            }  
        }
    }
}
